Skip to content

test(ingestion): cover newest-version selection in the Mlflow source#30198

Merged
pmbrull merged 5 commits into
mainfrom
test/mlflow-newest-version-coverage
Jul 20, 2026
Merged

test(ingestion): cover newest-version selection in the Mlflow source#30198
pmbrull merged 5 commits into
mainfrom
test/mlflow-newest-version-coverage

Conversation

@IceS2

@IceS2 IceS2 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #30191, addressing a Greptile review comment: the Mlflow integration test created a single model version, so max(..., key=version) was never exercised — a matcher that selected a stale version would still pass.

What

Register a second model version with distinct hyperparameters (alpha=0.2, l1_ratio=0.3), then assert the ingested entity carries the newest version's run (alpha=0.5, l1_ratio=1.0) and that the older version's values are absent. The log-model retry loop is extracted into a shared helper so both versions register through the same path.

Key finding

RegisteredModel.latest_versions returns a single element — the newest version — even with many versions registered (verified against MLflow 3.10 and 3.14: three versions still yield a one-element list). Stages were the only thing that produced multiple entries, and they are deprecated. So the connector's max() cannot be discriminated by min-vs-max no matter how many versions exist. What the second version does change is which run the connector reads (get_run(latest_version.run_id)), so asserting the ingested hyperparameters match the newest run is the meaningful coverage — it catches a regression that walked all versions and grabbed the oldest.

Verified locally against the testcontainers stack: the strengthened test fails with the pre-fix connector (Version not found) and passes with #30191's fix.

Note

This branch is stacked on #30191 and currently contains its commits too; the diff narrows to just the test once #30191 merges. Draft until then.

Greptile Summary

This PR strengthens the MLflow newest-version integration test. The main changes are:

  • Registers an older model version with distinct hyperparameters.
  • Extracts model logging and retry handling into a shared helper.
  • Verifies ingestion includes the newest run’s values and excludes stale values.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • Both versions are registered sequentially in distinct runs under the same model name.
  • The positive and negative assertions distinguish the newest run from the older run.

Important Files Changed

Filename Overview
ingestion/tests/integration/sources/mlmodels/mlflow/test_mlflow.py Registers two ordered model versions and verifies that ingestion uses the newest version’s run.

Reviews (1): Last reviewed commit: "test(ingestion): drop describe block dup..." | Re-trigger Greptile

Context used:

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)

IceS2 added 3 commits July 17, 2026 16:15
Fixes #30189

Select the newest registered model version by version number. Matching the
parent's last_updated_timestamp only held while the version creation was the
last write to the registered model; any later edit to its description, tags or
aliases desynced the two and silently dropped the model.

Point the Playwright Mlflow connection at sqlite backends. The placeholder
strings resolved to MLflow's file store, which 3.13+ rejects, so the AutoPilot
agent failed to connect and the run-completed banner never rendered.
search_registered_models returns a list of RegisteredModel, but the cast
claimed the collection itself was one. Iterating a RegisteredModel yields its
property pairs, so basedpyright inferred the loop variable as tuple[str, Any]
and rejected every attribute access on it. The cast was a no-op at runtime.

Modernize the annotations to PEP 585/604 while here, which retires the UP006,
UP035 and UP045 suppressions rather than moving them.
Register a second model version with distinct hyperparameters and assert the
ingested entity carries the newest version's run, not the older one's. Without
this the fixture created a single version, so a matcher that selected a stale
version would still pass. Extract the log-model retry into a helper shared by
both versions.
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Jul 17, 2026
Comment thread ingestion/tests/integration/sources/mlmodels/mlflow/test_mlflow.py
Squash-merging #30191 and then merging main back into this branch duplicated
the update_registered_model call, since git could not match the squashed block
to the branch's copy. Remove the redundant second block.
@IceS2
IceS2 marked this pull request as ready for review July 20, 2026 07:35
@IceS2
IceS2 requested a review from a team as a code owner July 20, 2026 07:35
Copilot AI review requested due to automatic review settings July 20, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (31 flaky)

✅ 4540 passed · ❌ 0 failed · 🟡 31 flaky · ⏭️ 95 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 434 0 6 16
✅ Shard 2 11 0 0 0
🟡 Shard 3 824 0 8 8
🟡 Shard 4 820 0 3 18
🟡 Shard 5 837 0 4 5
🟡 Shard 6 785 0 3 46
🟡 Shard 7 829 0 7 2
🟡 31 flaky test(s) (passed on retry)
  • Features/Pagination.spec.ts › should test pagination on Table version page columns (shard 1, 1 retry)
  • Features/TeamsDragAndDrop.spec.ts › Add teams in hierarchy (shard 1, 1 retry)
  • Flow/TestConnectionModal.spec.ts › Edit Connection click dismisses the modal (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from help section (shard 1, 2 retries)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Latest preview config wins when a superseded request resolves late (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary Term (Nested) (shard 3, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts › Full import cycle with dot in service name (shard 3, 1 retry)
  • Features/ContextCenterArchive.spec.ts › archive page lazy-loads more rows on scroll within its own scroll container (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › description: switching articles does not bleed unsaved content into next article (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › adding a linked asset in edit mode shows entity badge on the row (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › ArrowDown + Enter keyboard navigation selects the linked table result (shard 3, 1 retry)
  • Features/Glossary/GlossaryTermRelationsGraphNested.spec.ts › viewing a child term: parent appears as a 1-hop neighbour via parentOf edge (shard 4, 1 retry)
  • Features/Glossary/GlossaryTermRelationsGraphNested.spec.ts › viewing a child term: parentOf edge is rendered between parent and child (shard 4, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 4, 1 retry)
  • Flow/ServiceCreationPermissions.spec.ts › User can update connection details of their own service (shard 5, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Container (shard 5, 1 retry)
  • Pages/DataContracts.spec.ts › Contract Status badge should be visible on condition if Contract Tab is present/hidden by Persona (shard 5, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 5, 1 retry)
  • Pages/Entity.spec.ts › Delete Dashboard (shard 6, 1 retry)
  • Pages/ExploreBrowse.spec.ts › service type drill-down disables unrelated roots and query-panel Clear resets it (shard 6, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 6, 1 retry)
  • Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 7, 1 retry)
  • Pages/Glossary.spec.ts › Approve and reject glossary term from Glossary Listing (shard 7, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 7, 1 retry)
  • ... and 1 more

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@pmbrull
pmbrull merged commit 9a597a3 into main Jul 20, 2026
101 of 106 checks passed
@pmbrull
pmbrull deleted the test/mlflow-newest-version-coverage branch July 20, 2026 10:19
@gitar-bot

gitar-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Adds robust test coverage for MLflow version selection by registering multiple model versions and asserting hyperparameter ingestion. No issues found.

✅ 1 resolved
Quality: Duplicated update_registered_model call and comment

📄 ingestion/tests/integration/sources/mlmodels/mlflow/test_mlflow.py:175-181
Lines 179-181 are a verbatim copy of the block at 175-177 (same comment, same update_registered_model call). The second call is redundant — it re-applies the identical description and adds no coverage. Remove the duplicated block to keep the fixture clean.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants